﻿
using System;


namespace PuertsStaticWrap
{
    public static class System_Threading_Tasks_TaskFactory_Wrap
    {
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8ConstructorCallback))]
        private static IntPtr Constructor(IntPtr isolate, IntPtr info, int paramLen, long data)
        {
            try
            {
                
                if (paramLen == 0)
                {
                    
                    
                    
                    
                    {
                        
                        var result = new System.Threading.Tasks.TaskFactory();
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.TaskFactory), result);
                    }
                }
                
                if (paramLen == 1)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.CancellationToken>(false);
                        var result = new System.Threading.Tasks.TaskFactory(Arg0);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.TaskFactory), result);
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = new System.Threading.Tasks.TaskFactory(Arg0);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.TaskFactory), result);
                    }
                }
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = (System.Threading.Tasks.TaskCreationOptions)argHelper0.GetInt32(false);
                        var Arg1 = (System.Threading.Tasks.TaskContinuationOptions)argHelper1.GetInt32(false);
                        var result = new System.Threading.Tasks.TaskFactory(Arg0,Arg1);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.TaskFactory), result);
                    }
                }
                
                if (paramLen == 4)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.CancellationToken>(false);
                        var Arg1 = (System.Threading.Tasks.TaskCreationOptions)argHelper1.GetInt32(false);
                        var Arg2 = (System.Threading.Tasks.TaskContinuationOptions)argHelper2.GetInt32(false);
                        var Arg3 = argHelper3.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = new System.Threading.Tasks.TaskFactory(Arg0,Arg1,Arg2,Arg3);
                        
                        
                        return Puerts.Utils.GetObjectPtr((int)data, typeof(System.Threading.Tasks.TaskFactory), result);
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to System.Threading.Tasks.TaskFactory constructor");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
            return IntPtr.Zero;
        }
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void M_StartNew(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                
                if (paramLen == 1)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action>(false);
                        var result = obj.StartNew(Arg0);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action>(false);
                        var Arg1 = argHelper1.Get<System.Threading.CancellationToken>(false);
                        var result = obj.StartNew(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action>(false);
                        var Arg1 = (System.Threading.Tasks.TaskCreationOptions)argHelper1.GetInt32(false);
                        var result = obj.StartNew(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Object>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action<System.Object>>(false);
                        var Arg1 = argHelper1.Get<System.Object>(false);
                        var result = obj.StartNew(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 4)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action>(false);
                        var Arg1 = argHelper1.Get<System.Threading.CancellationToken>(false);
                        var Arg2 = (System.Threading.Tasks.TaskCreationOptions)argHelper2.GetInt32(false);
                        var Arg3 = argHelper3.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = obj.StartNew(Arg0,Arg1,Arg2,Arg3);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 3)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Object>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action<System.Object>>(false);
                        var Arg1 = argHelper1.Get<System.Object>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var result = obj.StartNew(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Object>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action<System.Object>>(false);
                        var Arg1 = argHelper1.Get<System.Object>(false);
                        var Arg2 = (System.Threading.Tasks.TaskCreationOptions)argHelper2.GetInt32(false);
                        var result = obj.StartNew(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 5)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    var argHelper4 = new Puerts.ArgumentHelper((int)data, isolate, info, 4);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Object>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper4.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Action<System.Object>>(false);
                        var Arg1 = argHelper1.Get<System.Object>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var Arg3 = (System.Threading.Tasks.TaskCreationOptions)argHelper3.GetInt32(false);
                        var Arg4 = argHelper4.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = obj.StartNew(Arg0,Arg1,Arg2,Arg3,Arg4);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to StartNew");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void M_FromAsync(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.IAsyncResult), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.IAsyncResult>), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.IAsyncResult>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.IAsyncResult>>(false);
                        var result = obj.FromAsync(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 3)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.IAsyncResult), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.IAsyncResult>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.IAsyncResult>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.IAsyncResult>>(false);
                        var Arg2 = (System.Threading.Tasks.TaskCreationOptions)argHelper2.GetInt32(false);
                        var result = obj.FromAsync(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Func<System.AsyncCallback, System.Object, System.IAsyncResult>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.IAsyncResult>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Func<System.AsyncCallback, System.Object, System.IAsyncResult>>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.IAsyncResult>>(false);
                        var Arg2 = argHelper2.Get<System.Object>(false);
                        var result = obj.FromAsync(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 4)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.IAsyncResult), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.IAsyncResult>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.IAsyncResult>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.IAsyncResult>>(false);
                        var Arg2 = (System.Threading.Tasks.TaskCreationOptions)argHelper2.GetInt32(false);
                        var Arg3 = argHelper3.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = obj.FromAsync(Arg0,Arg1,Arg2,Arg3);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Func<System.AsyncCallback, System.Object, System.IAsyncResult>), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.IAsyncResult>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Any, typeof(System.Object), false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Func<System.AsyncCallback, System.Object, System.IAsyncResult>>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.IAsyncResult>>(false);
                        var Arg2 = argHelper2.Get<System.Object>(false);
                        var Arg3 = (System.Threading.Tasks.TaskCreationOptions)argHelper3.GetInt32(false);
                        var result = obj.FromAsync(Arg0,Arg1,Arg2,Arg3);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to FromAsync");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void M_ContinueWhenAll(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task[]>), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task[]>>(false);
                        var result = obj.ContinueWhenAll(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 3)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task[]>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task[]>>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var result = obj.ContinueWhenAll(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task[]>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task[]>>(false);
                        var Arg2 = (System.Threading.Tasks.TaskContinuationOptions)argHelper2.GetInt32(false);
                        var result = obj.ContinueWhenAll(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 5)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    var argHelper4 = new Puerts.ArgumentHelper((int)data, isolate, info, 4);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task[]>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper4.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task[]>>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var Arg3 = (System.Threading.Tasks.TaskContinuationOptions)argHelper3.GetInt32(false);
                        var Arg4 = argHelper4.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = obj.ContinueWhenAll(Arg0,Arg1,Arg2,Arg3,Arg4);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to ContinueWhenAll");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void M_ContinueWhenAny(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                
                if (paramLen == 2)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task>), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task>>(false);
                        var result = obj.ContinueWhenAny(Arg0,Arg1);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 3)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task>>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var result = obj.ContinueWhenAny(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.Number, null, false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task>>(false);
                        var Arg2 = (System.Threading.Tasks.TaskContinuationOptions)argHelper2.GetInt32(false);
                        var result = obj.ContinueWhenAny(Arg0,Arg1,Arg2);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                if (paramLen == 5)
                {
                    
                    var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0);
                    var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1);
                    var argHelper2 = new Puerts.ArgumentHelper((int)data, isolate, info, 2);
                    var argHelper3 = new Puerts.ArgumentHelper((int)data, isolate, info, 3);
                    var argHelper4 = new Puerts.ArgumentHelper((int)data, isolate, info, 4);
                    
                    
                    if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.Task[]), false, false)
                        && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<System.Threading.Tasks.Task>), false, false)
                        && argHelper2.IsMatch(Puerts.JsValueType.NativeObject, typeof(System.Threading.CancellationToken), false, false)
                        && argHelper3.IsMatch(Puerts.JsValueType.Number, null, false, false)
                        && argHelper4.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject, typeof(System.Threading.Tasks.TaskScheduler), false, false))
                    {
                        
                        var Arg0 = argHelper0.Get<System.Threading.Tasks.Task[]>(false);
                        var Arg1 = argHelper1.Get<System.Action<System.Threading.Tasks.Task>>(false);
                        var Arg2 = argHelper2.Get<System.Threading.CancellationToken>(false);
                        var Arg3 = (System.Threading.Tasks.TaskContinuationOptions)argHelper3.GetInt32(false);
                        var Arg4 = argHelper4.Get<System.Threading.Tasks.TaskScheduler>(false);
                        var result = obj.ContinueWhenAny(Arg0,Arg1,Arg2,Arg3,Arg4);
                        
                        Puerts.ResultHelper.Set((int)data, isolate, info, result);
                        
                        return;
                    }
                }
                
                Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to ContinueWhenAny");
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_CancellationToken(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                var result = obj.CancellationToken;
                Puerts.ResultHelper.Set((int)data, isolate, info, result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_Scheduler(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                var result = obj.Scheduler;
                Puerts.ResultHelper.Set((int)data, isolate, info, result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_CreationOptions(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                var result = obj.CreationOptions;
                Puerts.PuertsDLL.ReturnNumber(isolate, info, (int)result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        [Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))]
        private static void G_ContinuationOptions(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data)
        {
            try
            {
                var obj = Puerts.Utils.GetSelf((int)data, self) as System.Threading.Tasks.TaskFactory;
                var result = obj.ContinuationOptions;
                Puerts.PuertsDLL.ReturnNumber(isolate, info, (int)result);
            }
            catch (Exception e)
            {
                Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace);
            }
        }
        
        
        
        
        
        public static Puerts.TypeRegisterInfo GetRegisterInfo()
        {
            return new Puerts.TypeRegisterInfo()
            {
                BlittableCopy = false,
                Constructor = Constructor,
                Methods = new System.Collections.Generic.Dictionary<Puerts.MethodKey, Puerts.V8FunctionCallback>()
                {
                    { new Puerts.MethodKey {Name = "StartNew", IsStatic = false},  M_StartNew },
                    { new Puerts.MethodKey {Name = "FromAsync", IsStatic = false},  M_FromAsync },
                    { new Puerts.MethodKey {Name = "ContinueWhenAll", IsStatic = false},  M_ContinueWhenAll },
                    { new Puerts.MethodKey {Name = "ContinueWhenAny", IsStatic = false},  M_ContinueWhenAny },
                    
                },
                Properties = new System.Collections.Generic.Dictionary<string, Puerts.PropertyRegisterInfo>()
                {
                    {"CancellationToken", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_CancellationToken, Setter = null} },
                    {"Scheduler", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_Scheduler, Setter = null} },
                    {"CreationOptions", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_CreationOptions, Setter = null} },
                    {"ContinuationOptions", new Puerts.PropertyRegisterInfo(){ IsStatic = false, Getter = G_ContinuationOptions, Setter = null} },
                    
                }
            };
        }
        
    }
}